<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>   
   <base href="<%=basePath%>"/>
    <title>广元电业局低质易耗品管理平台</title>
	<link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
     <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="js/updateStaff.js"></script>
      <script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
</head>

<body class="ContentBody">
<form action="updateStaff.action" method="post" onsubmit="return validateAll();">
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th class="tablestyle_title" >员工基本信息修改</th>
  </tr>
  <tr>
    <td class="CPanel">
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr>		
		   <td width="100%">
			  <fieldset style="height:100%;">
				<legend>员工信息</legend>			      
					  <table border="0" cellpadding="2" cellspacing="1" style="width:100%">					 
					  <tr>
					    <td nowrap="nowrap" align="right" width="15%">员工编号:</td>
					    <td width="35%">
					    <input name="staff.staid" type="text" class="text" style="width:154px" value="<s:property value='staff.staid'/>" disabled="disabled"/>
					    <input name="staff.staid" type="hidden" value="<s:property value='staff.staid'/>"/>
					    </td>
					     <td align="right">姓名:</td>
					   <td><input name="staff.staname" id="staname" type="text" class="text" style="width:154px" value="<s:property value='staff.staname'/>"/></td>			     
					  </tr>	
					  	
					  <tr>	
					   <td nowrap="nowrap" align="right" width="15%">负责人:</td>
					    <td width="35%">
					    	<s:if test='staff.fzr=="Y"'><input id="" name="staff.fzr" type="checkbox" checked="checked" value="Y"/></s:if>
					      <s:else><input id="" name="staff.fzr" type="checkbox" value="Y"/></s:else>
					    </td>                      			     
					 				             
					   <td align="right">经办人员:</td>
					   <td width="35%">
					    <s:if test='staff.jbr=="Y"'><input id="" name="staff.jbr" type="checkbox" checked="checked" value="Y"/></s:if>
					      <s:else><input id="" name="staff.jbr" type="checkbox" value="Y"/></s:else>
					   </td>
					  </tr> 
					  			 					    
					  <tr>					
                       <td align="right">职位:</td>
					   <td><input class="text" id="position" name="staff.staposition" style="width:154px" value="<s:property value='staff.staposition'/>"/></td>      
					   
					    <td align="right">所在部门:</td>
					   
					   <td><span style="color: red">
					         <s:property value="staff.department.depname"/>
                             <input type="hidden"  id="oldvalue" value="<s:property value='staff.department.depid'/>"/>
                           </span>
                          &nbsp;&nbsp;  调动到:
					        <select  class="text" id="newvalue">
                                <option selected="selected" class="text">==请选择==</option>
                               <s:iterator value="departments">
                                <s:if test="depid!=0">
                                 <option value="<s:property value='depid'/>" class="text" >
                                  <s:property value="depname"/>    
                                 </option>
                                </s:if>
                               </s:iterator> 
                            </select>&nbsp;&nbsp;
                            <span style="color: red">*</span>
                         </td>                             
					  </tr>
  		  
					  <tr> 
					  <td align="right">出生日期:</td>
					   <td>
					   <input class="text" style="width:154px" type="text"  value="<fmt:formatDate value='${staff.stabirth}' pattern='yyyy年MM月dd日'/>" onclick="WdatePicker()"/>
					   <input type="hidden" name="staff.stabirth" value="<s:property value='staff.stabirth'/>"/>
					   </td>  
					  <td align="right">籍贯:</td>
					    <td>
					    <input class="text" name="staff.stanative" style="width:154px" value="<s:property value='staff.stanative'/>"/></td>   
					    
					  </tr>                               
                			  
					  <tr>	
					  <td align="right">民族:</td>
					    <td><input class="text" name="staff.stanation" style="width:154px" value="<s:property value='staff.stanation'/>"/></td>
					   <td align="right">身份证号码:</td>
					    <td><input class="text" id="card" name="staff.stacard" style="width:154px" value="<s:property value='staff.stacard'/>"/></td>				    
					    
					  </tr>
					  		
					  <tr>
					    <td align="right">电话号码:</td>
					    <td><input class="text" id="statel" name="staff.statel" style="width:154px" value="<s:property value='staff.statel'/>"/></td>	    				   
					  	<td align="right">居住地址:</td>
					    <td><input  name="staff.staaddress"  type="text" size="30" style="width:154px" class="text" value="<s:property value='staff.staaddress'/>"/>                        </td>
					    <td>
					      <input type="hidden" name="staff.stasex" value="<s:property value='staff.stasex'/>"/>
					    </td>  
					  </tr>	
					   
					  <tr>
					    <td align="right">描述:</td>
					    <td colspan="3"><textarea name="staff.stanote" cols="100" rows="8" ><s:property value="staff.stanote"/></textarea></td>
					 </tr>
					 
				</table>
			  <br />
			</fieldset>	
		</td>
	</tr>
</table>	
 </td>
 </tr>			
		<tr>
			<td colspan="2" align="center" height="50px">
			<input type="submit" id="update" value="保存" class="button"/>　
			<input type="button" value="返回" class="button" onclick="window.history.go(-1);"/>
			</td>
		</tr> 
 </table>
</div>
  <input type="hidden" name="depid" id="actualvalue"/>
</form>

<script type="text/javascript">
  $(document).ready(function(){
    $('#update').click(function(){
     //假如在不调动部门的情况下  那么传的参数为员工所在部门的id
      $('#actualvalue').val($('#oldvalue').val());       
 //假如修改员工的同时   让员工调动了部门  那么传的参数为员工调动过后的部门的编号
     if($('#newvalue').val()!="==请选择==")
         { 
          $('#actualvalue').val($('#newvalue').val()); 
         }
      }); 
  });
</script>	
</body>
</html>

